﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace cs499.Database
{
    public static class DatabaseExtension
    {
        
        public static void PopulateNew(this Department department, String name, String Code){
            department.Name = name;
            department.Code = Code;
        }

        public static Course CreateCourse(this Department department, string coursetitle, int number, int numberofsections=1, int maxenroll=25) {
            Course newCourse = new Course();
            newCourse.Department = department;
            newCourse.CourseTitle = coursetitle;
            newCourse.DepartmentId = department.Id;
            newCourse.Number = number;
            newCourse.NumberOfSections = numberofsections;
            newCourse.MaximumEnrollment = maxenroll;
            return newCourse;
        }
    }
}